<template>
    <el-config-provider :locale="language" :size="flag?'small':'default'">
        <router-view></router-view>
    </el-config-provider>
</template>
<script lang="ts" setup>
import {useI18n} from 'vue-i18n';
import {publicFun} from "@/config/function"
import {ElConfigProvider} from "element-plus"
import {computed, onMounted} from 'vue'
import {storeToRefs} from "pinia";
import {useSettingStore} from "@/stores/modules/setting";

const settingStore = useSettingStore()
const {flag} = storeToRefs(settingStore)
const {messages, locale} = useI18n();

// 获取全局 i18n
const language = computed(() => {
    return messages.value[locale.value];
});

publicFun();
onMounted(() => {
    console.log('lang:' + locale.value);
    // console.log(language.value)
})
</script>
<style></style>
